<?php /* Smarty version Smarty 3.1.4, created on 2012-05-04 13:28:39
         compiled from ".\templates\product\addfeatures.tpl" */ ?>
<?php /*%%SmartyHeaderCode:79934fa3d98729cc93-65563835%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'bfbf02b402d4d7b837d84fd089553e67c113e3b2' => 
    array (
      0 => '.\\templates\\product\\addfeatures.tpl',
      1 => 1335536183,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '79934fa3d98729cc93-65563835',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'temp_options' => 0,
    'title' => 0,
    'productdet_arr' => 0,
    'productid' => 0,
    'formaction' => 0,
    'struct_arr' => 0,
    'catid' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty 3.1.4',
  'unifunc' => 'content_4fa3d987542a3',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_4fa3d987542a3')) {function content_4fa3d987542a3($_smarty_tpl) {?><script language="javascript">
var counter = 1;
var limit = 100;
function addInput(divName,num) {
     if (counter == limit)   {
          alert("You have reached the limit of adding " + counter + " inputs");
     }
     else  {
          var newdiv = document.createElement('div');
          var param="structkey_"+String(counter);
          newdiv.innerHTML = "<br><select id='structkeyopt_"+counter+"' onchange='disabletext("+counter+");' style='width: 200px;' class='inp-form' name='structkeyopt'><?php echo $_smarty_tpl->tpl_vars['temp_options']->value;?>
</select>&nbsp; <input class='inp-form' style='width: 200px;' type='text' name='structkey' id='structkey_"+counter+"' />&nbsp;<input class='inp-form' style='width: 500px;' type='text' name='structval' id='structval' /><br>";
          document.getElementById(divName).appendChild(newdiv);
          counter++;
     }
}
</script>
<div id="page-heading">
	<h1><?php echo $_smarty_tpl->tpl_vars['title']->value;?>
</h1>
          <?php if (isset($_smarty_tpl->tpl_vars['smarty']->value['section']['sec3'])) unset($_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']);
$_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['name'] = 'sec3';
$_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['loop'] = is_array($_loop=$_smarty_tpl->tpl_vars['productdet_arr']->value) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['show'] = true;
$_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['max'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['loop'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['step'] = 1;
$_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['start'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['step'] > 0 ? 0 : $_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['loop']-1;
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['show']) {
    $_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['total'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['loop'];
    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['total'] == 0)
        $_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['show'] = false;
} else
    $_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['total'] = 0;
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['show']):

            for ($_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['index'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['start'], $_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['iteration'] = 1;
                 $_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['iteration'] <= $_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['total'];
                 $_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['index'] += $_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['step'], $_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['iteration']++):
$_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['rownum'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['iteration'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['index_prev'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['index'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['index_next'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['index'] + $_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['first']      = ($_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['iteration'] == 1);
$_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['last']       = ($_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['iteration'] == $_smarty_tpl->tpl_vars['smarty']->value['section']['sec3']['total']);
?>
        <h2><?php echo $_smarty_tpl->tpl_vars['productdet_arr']->value[$_smarty_tpl->getVariable('smarty')->value['section']['sec3']['index']]['title'];?>
</h2>
         <h3><?php echo $_smarty_tpl->tpl_vars['productdet_arr']->value[$_smarty_tpl->getVariable('smarty')->value['section']['sec3']['index']]['add_id'];?>
</h3>
         <br>
         <a onclick="loadPage('product/index')" href="javascript: void(0);">Back to product list</a>
          &nbsp;
           <a onclick="loadPage('product/addproduct/101000100001');" href="javascript: void(0);">Add new product</a>
          &nbsp;
         <a onclick="loadPage('product/editproduct/<?php echo $_smarty_tpl->tpl_vars['productid']->value;?>
');" href="javascript: void(0);">Back to prodcuct details</a>
          &nbsp;
         <a onclick="loadPage('product/addimage/<?php echo $_smarty_tpl->tpl_vars['productid']->value;?>
');" href="javascript: void(0);">Add product image</a>

            <?php endfor; endif; ?>
</div>
<form method="post" id="myForm" action="<?php echo $_smarty_tpl->tpl_vars['formaction']->value;?>
">
    <div id="dynamicInput">
      <?php if (isset($_smarty_tpl->tpl_vars['smarty']->value['section']['sec1'])) unset($_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']);
$_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['name'] = 'sec1';
$_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['loop'] = is_array($_loop=$_smarty_tpl->tpl_vars['struct_arr']->value) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['show'] = true;
$_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['max'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['loop'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['step'] = 1;
$_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['start'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['step'] > 0 ? 0 : $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['loop']-1;
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['show']) {
    $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['total'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['loop'];
    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['total'] == 0)
        $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['show'] = false;
} else
    $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['total'] = 0;
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['show']):

            for ($_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['index'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['start'], $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['iteration'] = 1;
                 $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['iteration'] <= $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['total'];
                 $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['index'] += $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['step'], $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['iteration']++):
$_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['rownum'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['iteration'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['index_prev'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['index'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['index_next'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['index'] + $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['first']      = ($_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['iteration'] == 1);
$_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['last']       = ($_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['iteration'] == $_smarty_tpl->tpl_vars['smarty']->value['section']['sec1']['total']);
?>
    <br>
       <select name="structkeyopt" id="structkeyopt_<?php echo $_smarty_tpl->tpl_vars['struct_arr']->value[$_smarty_tpl->getVariable('smarty')->value['section']['sec1']['index']]['structid'];?>
" style="width: 200px;" onchange="disabletext('<?php echo $_smarty_tpl->tpl_vars['struct_arr']->value[$_smarty_tpl->getVariable('smarty')->value['section']['sec1']['index']]['structid'];?>
');">
	<?php echo $_smarty_tpl->tpl_vars['temp_options']->value;?>

     </select>
        <input value="<?php echo $_smarty_tpl->tpl_vars['struct_arr']->value[$_smarty_tpl->getVariable('smarty')->value['section']['sec1']['index']]['structkey'];?>
" class="inp-form" style="width: 200px;" type="text" name="structkey" id="structkey_<?php echo $_smarty_tpl->tpl_vars['struct_arr']->value[$_smarty_tpl->getVariable('smarty')->value['section']['sec1']['index']]['structid'];?>
" />
       <input value="<?php echo $_smarty_tpl->tpl_vars['struct_arr']->value[$_smarty_tpl->getVariable('smarty')->value['section']['sec1']['index']]['structvalue'];?>
"  class="inp-form" style="width: 500px;" type="text" name="structval" id="structval" />
       <a  href="javascript: void(0);" onclick="deletestructurefield(<?php echo $_smarty_tpl->tpl_vars['struct_arr']->value[$_smarty_tpl->getVariable('smarty')->value['section']['sec1']['index']]['structid'];?>
,<?php echo $_smarty_tpl->tpl_vars['productid']->value;?>
);"><img src="images/icons/a-minus.gif" />Delete</a>
       <br>
     <?php endfor; endif; ?>
    </div>
    <br>
    <input type="button" value="Add another field" onClick="addInput('dynamicInput',1);">
    <div>
	<td>&nbsp;<input type="hidden" name="productid" id="productid" value="<?php echo $_smarty_tpl->tpl_vars['productid']->value;?>
" />
        <input type="hidden" name="catid" id="productid" value="<?php echo $_smarty_tpl->tpl_vars['catid']->value;?>
" />
        </td>
	<td><div class="edit-icoset"><a href="javascript: void(0);" onclick="saveFeatures(<?php echo $_smarty_tpl->tpl_vars['productid']->value;?>
);"><img src="images/icons/save-2.gif" />Save</a></div>
   
        </td>
   </div>
</form>

<script type="text/javascript">

    function disabletext(x)
        {
             var txtbox="#structkey_"+String(x);
             var dropdown="#structkeyopt_"+String(x);
             var selectedval=$(dropdown).val();
             //alert(selectedval);
             if(selectedval=='')
             {
                 $(''+txtbox+'').removeAttr("disabled")
             }
             else
             {
                 $(''+txtbox+'').attr("disabled", "disabled");
             }
        }
</script>

<?php }} ?>